package cn.bandeqing.orderDiscounts.entity;

import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import cn.bandeqing.order.req.OrderDiscountsSaveReq;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 订单优惠 实体类。
 *
 * @author fugui
 * @since 2024-01-30
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "bdq_order_discounts", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMapper(target = OrderDiscountsSaveReq.class, convertGenerate = false)
public class OrderDiscounts extends BaseEntity {

    @Id(keyType = KeyType.Auto)
    private Long discountsId;

    private Long orderId;

    /**
     * 优惠之前的总价
     */
    private Double beforeTotalPrice;

    /**
     * 优惠金额
     */
    private Double discountsMoney;

    private DiscountsType discountsType;

    /**
     * 优惠之后的总价
     */
    private Double afterTotalPrice;

    /**
     * 备注
     */
    private String discountsRemark;

}
